package com.education.welco.enums;


public enum DbEnumsUtil {

	QUESTIONTYPE_ONE("1", "单选"),
	QUESTIONTYPE_TWO("2", "判断"),
	QUESTIONTYPE_THREE("3", "多选"),
	QUESTIONTYPE_FOUR("4", "简答"),
	;

	private String type;
	private String desc;

	DbEnumsUtil(String type, String desc) {
		this.type = type;
		this.desc = desc;
	}
	
	// 普通方法  传入type,获取描述
    public static String getDesc(String type) {
        for (DbEnumsUtil c : DbEnumsUtil.values()) {
            if (c.getType().equals(type)) {
                return c.getDesc();
            }
        }
        return "未知";
    }
    
	public String getType() {
		return type;
	}

	public void setType(String type) {
		this.type = type;
	}

	public String getDesc() {
		return desc;
	}

	public void setDesc(String desc) {
		this.desc = desc;
	}
}

